<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Wang Ziming
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <div class="nav-eva">
        <span>我的评价</span>
        <span><a href="/personalInformation?pageNum=3&item=0" id="info1">我的评价</a></span>
        <span><a href="/personalInformation?pageNum=3&item=1" id="info2">与我相关</a></span>
    </div>
    <hr>

    <%--列表table--%>
    <c:choose>
        <c:when test="${item=='0'}">
            <%--罗六子 9 2020/9/12 18:00
            <button>删除</button>--%>
            <table align="center" width="100%">
                <thead>
                <tr>
                    <th>我评价的用户</th>
                    <th>分数</th>
                    <th>时间</th>
                </tr>
                </thead>
                <tbody align="center">
                    <%--c:forEach--%>
                    <c:forEach items="${myEvaluations}" var="myEvaluation">
                        <tr>
                            <%--名字部分可能为空，从根源上消除这个情况--%>
                            <td>${myEvaluation.userName}</td>
                            <td>${myEvaluation.score}</td>
                            <td>${myEvaluation.time}</td>
                        </tr>
                    </c:forEach>
                </tbody>
            </table>
        </c:when>
        <c:when test="${item=='1'}">
            <%--王铁锤 杭州我做主 2020/9/12 18:00--%>
            <table align="center" width="100%">
                <thead>
                <tr>
                    <th>评价我的用户</th>
                    <th>分数</th>
                    <th>时间</th>
                </tr>
                </thead>
                <tbody align="center">
                    <%--c:forEach--%>
                    <c:forEach items="${otherEvaluations}" var="otherEvaluation">
                        <tr>
                            <td>${otherEvaluation.userName}</td>
                            <td>${otherEvaluation.score}</td>
                            <td>${otherEvaluation.time}</td>
                        </tr>
                    </c:forEach>
                </tbody>
            </table>
        </c:when>
    </c:choose>
</body>
<style>
    .nav-eva{
        margin-top: 3%;
    }
    #info1{
        margin-left: 58%;
    }
</style>
</html>
